<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>过期药品界面</title>
    <link rel="stylesheet" href="../css/overdue.css">
    <script src="../js/jquery.js"></script>
    <script src="../js/overdue.js"></script>
</head>
<body>
<div id="flex">
    <button id="overdue-add">新增信息</button>
    <div id="selectOverdueNameInput">
        <label for="nameOverdueInput">药品名称</label>
        <input type="text" id="nameOverdueInput" placeholder="请输入药品名称">
        <button class="overdue-select-btn" id="overdueNameSelectBtn">点击查询</button>
    </div>
    <!--//输入供应商查询方式-->
    <div id="selectOverdueDateInput">
        <label for="dateOverdueInput">处理日期</label>
        <input type="date" id="dateOverdueInput" placeholder="请输入处理日期">
        <button class="overdue-select-btn" id="overdueDateSelectBtn">点击查询</button>
    </div>
    <!--//输入日期查询方式-->
    <div id="selectOverduePersonInput">
        <label for="personOverdueInput">处理人</label>
        <input type="text" id="personOverdueInput" placeholder="请输入处理人姓名">
        <button class="overdue-select-btn" id="overduePersonSelectBtn">点击查询</button>
    </div>
</div>
<hr/>

<!--//显示查询信息-->
<div class="overdue-history-information">
    <table id="tb_3" cellspacing="0" cellpadding="2" width="100%" border="1">
        <tbody>
        <tr align="center" bgcolor="#dcdcdc">
            <td style="width:100px;">处理编号</td>
            <td>药品名称</td>
            <td>药品单位</td>
            <td>药品规格</td>
            <td>处理数量</td>
            <td>处理时间</td>
            <td>处理人</td>
            <td>处理说明</td>
            <td>处理备注</td>
            <td>操作</td>
        </tr>
        <!--<tr>-->
            <!--<td style="width:100px;">201901041643</td>-->
            <!--<td>药品名称</td>-->
            <!--<td>和</td>-->
            <!--<td>100*100</td>-->
            <!--<td>12</td>-->
            <!--<td>2019/01/04</td>-->
            <!--<td>小张</td>-->
            <!--<td>无</td>-->
            <!--<td>无</td>-->
            <!--<td>-->
                <!--<button class="overdue-table-update-btn">编辑</button>-->
                <!--<button class="overdue-table-cancel-btn">删除</button>-->
            <!--</td>-->
        <!--</tr>-->
        </tbody>
    </table>
</div>
<!-- 新增信息界面 -->
<div id="overdueInput">
    <div>
        <label for="overdue-num">编号</label>
        <input type="text" class="overdue-input" id="overdue-num" placeholder="请输入药品编号">
        <span class="judge" id="judgeNum"></span>
    </div>
    <div>
        <label for="overdue-name">药品名称</label>
        <input type="text" class="overdue-input" id="overdue-name" placeholder="请输入药品名称">
        <span class="judge" id="judgeName"></span>
    </div>
    <div>
        <label for="overdue-count">药品数量</label>
        <input type="number" class="overdue-input" id="overdue-count" placeholder="请输入药品数量">
        <span class="judge" id="judgeCount"></span>
    </div>
    <div>
        <label for="overdue-data">处理时间</label>
        <input type="date" class="overdue-input" id="overdue-data" placeholder="请输入处理时间">
        <span class="judge" id="judgeDate"></span>
    </div>
    <div>
        <label for="overdue-person">处理人</label>
        <input type="text" class="overdue-input" id="overdue-person" placeholder="请输入处理人">
        <span class="judge" id="judgePerson"></span>
    </div>
    <div>
        <label for="overdue-explain">处理说明</label>
        <input type="text" class="overdue-input" id="overdue-explain" placeholder="请输入处理说明">
    </div>
    <div>
        <label for="overdue-remake">备注</label>
        <input type="text" class="overdue-input" id="overdue-remake" placeholder="请输入备注信息">
    </div>
    <div class="overdue-add-btn">
        <button id="overdue-add-sure">确认</button>
        <button id="overdue-add-back">返回</button>
    </div>
</div>


<!-- 编辑页面 -->
<div class="all-overdue-update-input">
    <div><label for="overdue-update-input-num">处理编号</label>
        <input class="overdue-update-input" type="text" id="overdue-update-input-num" value="" readonly="readonly">
    </div>
    <div><label for="overdue-update-input-name">药品名称</label>
        <input class="overdue-update-input" type="text" id="overdue-update-input-name" value="" readonly="readonly">
    </div>
    <div><label for="overdue-update-input-unit">单位</label>
        <input class="overdue-update-input" type="text" id="overdue-update-input-unit" value="" readonly="readonly">
    </div>
    <div><label for="overdue-update-input-type">规格</label>
        <input class="overdue-update-input" type="text" id="overdue-update-input-type" value="" readonly="readonly">
    </div>
    <div><label for="overdue-update-input-count">数量</label>
        <input class="overdue-update-input" type="number" id="overdue-update-input-count" value="">
    </div>
    <div><label for="overdue-update-input-data">日期</label>
        <input class="overdue-update-input" type="date" id="overdue-update-input-data" value="">
    </div>
    <div><label for="overdue-update-input-person">处理人</label>
        <input class="overdue-update-input" type="text" id="overdue-update-input-person" value="">
    </div>
    <div><label for="overdue-update-input-explain">处理说明</label>
        <input class="overdue-update-input" type="text" id="overdue-update-input-explain" value="">
    </div>
    <div><label for="overdue-update-input-remark">处理备注</label>
        <input class="overdue-update-input" type="text" id="overdue-update-input-remark" value="">
    </div>
    <div class="overdue-add-button">
        <button id="addOverdue-update-sure" type="submit">确认</button>
        <button id="addOverdue-update-back" type="submit">返回</button>
    </div>
</div>
<div id="over"></div>


<script type="text/javascript">
    var tTD; //用来存储当前更改宽度的Table Cell,避免快速移动鼠标的问题
    var table = document.getElementById("tb_3");
    for (j = 0; j < table.rows[0].cells.length; j++) {
        table.rows[0].cells[j].onmousedown = function () {
//记录单元格
            tTD = this;
            if (event.offsetX > tTD.offsetWidth - 10) {
                tTD.mouseDown = true;
                tTD.oldX = event.x;
                tTD.oldWidth = tTD.offsetWidth;
            }
//记录Table宽度
//table = tTD; while (table.tagName != ‘TABLE') table = table.parentElement;
//tTD.tableWidth = table.offsetWidth;
        };
        table.rows[0].cells[j].onmouseup = function () {
//结束宽度调整
            if (tTD == undefined) tTD = this;
            tTD.mouseDown = false;
            tTD.style.cursor = 'default';
        };
        table.rows[0].cells[j].onmousemove = function () {
//更改鼠标样式
            if (event.offsetX > this.offsetWidth - 10)
                this.style.cursor = 'col-resize';
            else
                this.style.cursor = 'default';
//取出暂存的Table Cell
            if (tTD == undefined) tTD = this;
//调整宽度
            if (tTD.mouseDown != null && tTD.mouseDown == true) {
                tTD.style.cursor = 'default';
                if (tTD.oldWidth + (event.x - tTD.oldX) > 0)
                    tTD.width = tTD.oldWidth + (event.x - tTD.oldX);
//调整列宽
                tTD.style.width = tTD.width;
                tTD.style.cursor = 'col-resize';
//调整该列中的每个Cell
                table = tTD;
                while (table.tagName != 'TABLE') table = table.parentElement;
                for (j = 0; j < table.rows.length; j++) {
                    table.rows[j].cells[tTD.cellIndex].width = tTD.width;
                }
//调整整个表
//table.width = tTD.tableWidth + (tTD.offsetWidth – tTD.oldWidth);
//table.style.width = table.width;
            }
        };
    }
</script>
</body>
</html>